Skip to main content

ADX Functions

ProcessOneHourAggregates

Description: Called at intervals to add to the OneHourAggregatesRaw table from TimeSeriesData.

Parameters:

  • None

Usage:

ProcessOneHourAggregates()

ProcessCurrentValues

Description: Called at intervals to add to the CurrentValuesRaw table from TimeSeriesData.

Parameters:

  • None

Usage:

ProcessCurrentValues()

CheckStartEndTime

Description: Assert function to check start and end time.

Parameters:

  • Start: datetime
  • End: datetime

Usage:

CheckStartEndTime(Start, End)

TrendRaw

Description: Trend function for tags based on raw data.

Parameters:

  • Tags: dynamic
  • Start: datetime
  • End: datetime

Usage:

TrendRaw(Tags, Start, End)

GetTrendRawCount

Description: Function that gets count from TrendRaw function.

Parameters:

  • Tags: dynamic
  • Start: datetime
  • End: datetime

Usage:

GetTrendRawCount(Tags, Start, End)

Trend

Description: Trend function for analog tags based on aggregated data.

Parameters:

  • Tags: dynamic
  • Start: datetime
  • End: datetime
  • Interval: timespan

Usage:

Trend(Tags, Start, End, Interval)

TrendDiscrete

Description: Trend function for discrete data.

Parameters:

  • Tags: dynamic
  • Start: datetime
  • End: datetime
  • TimeWindowLimit: timespan (default: 30d)

Usage:

TrendDiscrete(Tags, Start, End, TimeWindowLimit)

GetDataStreamMetaData

Description: Returns the latest DataStreamMetaData filtered using tag's TimeSeriesId.

Parameters:

  • TimeSeriesIds: dynamic (default: dynamic(null))

Usage:

GetDataStreamMetaData(TimeSeriesIds)

GetDataStreamMetaDataByTagName

Description: Returns the latest DataStreamMetaData filtered using tag's Name.

Parameters:

  • TagNames: dynamic

Usage:

GetDataStreamMetaDataByTagName(TagNames)

GetLatestModelVersionBySource

Description: Find latest model version by source.

Parameters:

  • SourceSystemSeries: dynamic (default: dynamic(null))

Usage:

GetLatestModelVersionBySource(SourceSystemSeries)

GetLatestDataModel

Description: Get latest model by source.

Parameters:

  • SourceSystemSeries: dynamic (default: dynamic(null))
  • PropertyTypeSeries: dynamic (default: dynamic(null))

Usage:

GetLatestDataModel(SourceSystemSeries, PropertyTypeSeries)

GetPropertiesByPath

Description: Get properties by path.

Parameters:

  • PropertyNameIn: dynamic
  • PathIn: dynamic

Usage:

GetPropertiesByPath(PropertyNameIn, PathIn)

GetTagsByPath

Description: Get tags by path.

Parameters:

  • InputPath: dynamic

Usage:

GetTagsByPath(InputPath)

GetTagsByPathAsc

Description: Get tags by path in ascending order of tag name.

Parameters:

  • InputPath: dynamic

Usage:

GetTagsByPathAsc(InputPath)

GetTagsByPathDesc

Description: Get tags by path in descending order of tag name.

Parameters:

  • InputPath: dynamic

Usage:

GetTagsByPathDesc(InputPath)

GetChildrenByPath

Description: Get child nodes of the node at the given path.

Parameters:

  • InputPath: dynamic

Usage:

GetChildrenByPath(InputPath)

GetSpecsByPath

Description: Get nodes of type 'specification' under the given path.

Parameters:

  • PathIn: dynamic

Usage:

GetSpecsByPath(PathIn)

GetHierarchies

Description: Get all available source systems.

Parameters:

  • None

Usage:

GetHierarchies()

GetPropertiesByPathWithFilters

Description: Get nodes under the given path whose class, property type, and property name match the given filters.

Parameters:

  • PropertyNameIn: dynamic
  • PtypeIn: dynamic
  • ClassIn: dynamic
  • PathIn: dynamic

Usage:

GetPropertiesByPathWithFilters(PropertyNameIn, PtypeIn, ClassIn, PathIn)

GetTimeSeriesIdByTagName

Description: Returns list of TimeSeriesId's and TimeSeriesId-Name key-value pairs for the target TagNames.

Parameters:

  • TagNames: dynamic
  • SubsetTagNames: dynamic (default: dynamic(null))

Usage:

GetTimeSeriesIdByTagName(TagNames, SubsetTagNames)

GetAggregates

Description: Returns only materialized portion of OneHourAggregation view using tag's TimeSeriesId.

Parameters:

  • TimeSeries: dynamic
  • StartTime: datetime
  • EndTime: datetime

Usage:

GetAggregates(TimeSeries, StartTime, EndTime)

GetAggregatesByTagName

Description: GetAggregates result using tag's Name.

Parameters:

  • TagNames: dynamic
  • StartTime: datetime
  • EndTime: datetime

Usage:

GetAggregatesByTagName(TagNames, StartTime, EndTime)

GetEvents

Description: Returns events in TimeSeriesData table for the target TimeSeriesId's and the time range.

Parameters:

  • TimeSeries: dynamic
  • StartTime: datetime
  • EndTime: datetime

Usage:

GetEvents(TimeSeries, StartTime, EndTime)

GetEventsByTagName

Description: GetEvents result using tag Name.

Parameters:

  • TagNames: dynamic
  • StartTime: datetime
  • EndTime: datetime

Usage:

GetEventsByTagName(TagNames, StartTime, EndTime)

ProcessAndEnrich

Description: Function processes raw ingestion records, replicating RangeDelete and RangeRefresh actions, and enriching all records.

Parameters:

  • None

Usage:

ProcessAndEnrich()

GetCurrentValue

Description: Returns CurrentValue view result using tag's TimeSeriesId.

Parameters:

  • TimeSeries: dynamic

Usage:

GetCurrentValue(TimeSeries)

GetCurrentValueByTagName

Description: GetCurrentValue result using tag's Name.

Parameters:

  • TagNames: dynamic

Usage:

GetCurrentValueByTagName(TagNames)

SearchDataModel

Description: Search string from the latest records in DataModels table.

Parameters:

  • Searchstring: string
  • ResultCountLimit: int (default: 1000)

Usage:

SearchDataModel(Searchstring, ResultCountLimit)

GetStateSets

Description: Returns StateSets table records; takes optional argument to filter Name in StateSets.

Parameters:

  • StateSetName: dynamic (default: dynamic(null))

Usage:

GetStateSets(StateSetName)

GetAllChildTSIDsByPath

Description: Get All Child TSIDs By Path.

Parameters:

  • InputPath: dynamic

Usage:

GetAllChildTSIDsByPath(InputPath)

GetValueAfterTimeStampByTagName

Description: Tag Name-based function to retrieve first recorded value after the specified time.

Parameters:

  • TagNames: dynamic
  • TimeRequested: datetime

Usage:

GetValueAfterTimeStampByTagName(TagNames, TimeRequested)

GetValueAtOrAfterTimeStampByTagName

Description: Tag Name-based function to retrieve first recorded value at or after the specified time.

Parameters:

  • TagNames: dynamic
  • TimeRequested: datetime

Usage:

GetValueAtOrAfterTimeStampByTagName(TagNames, TimeRequested)

GetValueAtOrBeforeTimeStampByTagName

Description: Tag Name-based function to retrieve first recorded value at or before the specified time.

Parameters:

  • TagNames: dynamic
  • TimeRequested: datetime

Usage:

GetValueAtOrBeforeTimeStampByTagName(TagNames, TimeRequested)

GetValueBeforeTimeStampByTagName

Description: Tag Name-based function to retrieve last recorded value before the specified time.

Parameters:

  • TagNames: dynamic
  • TimeRequested: datetime

Usage:

GetValueBeforeTimeStampByTagName(TagNames, TimeRequested)

GetInterpolatedValueByTagName

Description: Tag Name-based function to retrieve interpolated value at the specified time, using the Stepped parameter to determine interpolation type.

Parameters:

  • TagNames: dynamic
  • TimeRequested: datetime

Usage:

GetInterpolatedValueByTagName(TagNames, TimeRequested)

GetValueAfterTimeStamp

Description: TimeSeriesId-based function to retrieve first recorded value after the specified time.

Parameters:

  • TimeSeries: dynamic
  • TimeRequested: datetime

Usage:

GetValueAfterTimeStamp(TimeSeries, TimeRequested)

GetValueAtOrBeforeTimeStamp

Description: TimeSeriesId-based function to retrieve first recorded value at or before the specified time.

Parameters:

  • TimeSeries: dynamic
  • TimeRequested: datetime

Usage:

GetValueAtOrBeforeTimeStamp(TimeSeries, TimeRequested)

GetValueBeforeTimeStamp

Description: TimeSeriesId-based function to retrieve last recorded value before the specified time.

Parameters:

  • TimeSeries: dynamic
  • TimeRequested: datetime

Usage:

GetValueBeforeTimeStamp(TimeSeries, TimeRequested)

GetValueAtOrAfterTimeStamp

Description: TimeSeriesId-based function to retrieve first recorded value at or after the specified time.

Parameters:

  • TimeSeries: dynamic
  • TimeRequested: datetime

Usage:

GetValueAtOrAfterTimeStamp(TimeSeries, TimeRequested)

GetInterpolatedValue

Description: TimeSeriesId function to retrieve interpolated value at the specified time, using the Stepped parameter to determine interpolation type.

Parameters:

  • TimeSeries: dynamic
  • TimeRequested: datetime

Usage:

GetInterpolatedValue(TimeSeries, TimeRequested)

GetQualityCodeFilteredData

Description: Convert StandardQualityCode to integer, then filter for good values.

Parameters:

  • Tbl: (StandardQualityCode:string, RealValue:real)
  • TreatUncertainAsBad: bool
  • NonNullRealValueOnly: bool (default: true)

Usage:

GetQualityCodeFilteredData(Tbl, TreatUncertainAsBad, NonNullRealValueOnly)

GetDataWithTimeGrid

Description: Function for merging source data with time grid.

Parameters:

  • TimeSeries: dynamic
  • StartTime: datetime
  • EndTime: datetime
  • Interval: timespan
  • TreatUncertainAsBad: bool (default: true)
  • SteppedSeries: dynamic (default: dynamic(null))

Usage:

GetDataWithTimeGrid(TimeSeries, StartTime, EndTime, Interval, TreatUncertainAsBad, SteppedSeries)

GetLinearInterpolate

Description: TimeSeriesId-based linear/stepped Interpolation Function.

Parameters:

  • TimeSeries: dynamic
  • StartTime: datetime
  • EndTime: datetime
  • Interval: timespan
  • TreatUncertainAsBad: bool (default: true)
  • SteppedSeries: dynamic (default: dynamic(null))
  • ReturnInterpValOnly: bool (default: true)

Usage:

GetLinearInterpolate(TimeSeries, StartTime, EndTime, Interval, TreatUncertainAsBad, SteppedSeries, ReturnInterpValOnly)

GetIntegral

Description:
Calculates the integral (area under the curve) for a given time series. Supports linear and stepped calculations.

Parameters:

  • TimeSeries: dynamic
  • StartTime: datetime
  • EndTime: datetime
  • Interval: timespan
  • MaxAllowDiffTimeLinear: timespan = time(null)
  • MaxAllowDiffTimeStepped: timespan = time(3650.00:00:00)
  • TreatUncertainAsBad: bool = true
  • SteppedSeries: dynamic = dynamic(null)
  • MinRawValCount: int = 0

Usage:

GetIntegral(TimeSeries, StartTime, EndTime, Interval, MaxAllowDiffTimeLinear, MaxAllowDiffTimeStepped, TreatUncertainAsBad, SteppedSeries, MinRawValCount)

GetTimeWeightedAverage

Description:
Calculates the time-weighted average for a given time series. Supports linear and stepped calculations.

Parameters:

  • TimeSeries: dynamic
  • StartTime: datetime
  • EndTime: datetime
  • Interval: timespan
  • MaxAllowDiffTimeLinear: timespan = time(null)
  • MaxAllowDiffTimeStepped: timespan = time(3650.00:00:00)
  • TreatUncertainAsBad: bool = true
  • SteppedSeries: dynamic = dynamic(null)
  • MinRawValCount: int = 0

Usage:

GetTimeWeightedAverage(TimeSeries, StartTime, EndTime, Interval, MaxAllowDiffTimeLinear, MaxAllowDiffTimeStepped, TreatUncertainAsBad, SteppedSeries, MinRawValCount)

GetPercentiles

Description:
Calculates percentiles for a given time series by sorting values and assigning row numbers.

Parameters:

  • TimeSeries: dynamic
  • StartTime: datetime
  • EndTime: datetime
  • PercentileArray: dynamic = dynamic([25, 50, 75])
  • TreatUncertainAsBad: bool = true

Usage:

GetPercentiles(TimeSeries, StartTime, EndTime, PercentileArray, TreatUncertainAsBad)

GetPercentileEstimates

Description:
Calculates percentile estimates using T-Digest for approximation.

Parameters:

  • TimeSeries: dynamic
  • StartTime: datetime
  • EndTime: datetime
  • PercentileArray: dynamic = dynamic([25, 50, 75])
  • TreatUncertainAsBad: bool = true

Usage:

GetPercentileEstimates(TimeSeries, StartTime, EndTime, PercentileArray, TreatUncertainAsBad)

GetStatistics

Description:
Calculates various statistics (first, last, min, max, avg, standard deviation, count) for a given time series.

Parameters:

  • TimeSeries: dynamic
  • StartTime: datetime
  • EndTime: datetime
  • TreatUncertainAsBad: bool = true
  • ExcludeFirst: bool = false
  • ExcludeLast: bool = false

Usage:

GetStatistics(TimeSeries, StartTime, EndTime, TreatUncertainAsBad, ExcludeFirst, ExcludeLast)

GetTimeInState

Description:
Calculates the time spent in each state for a given time series.

Parameters:

  • TimeSeries: dynamic
  • StartTime: datetime
  • EndTime: datetime
  • Interval: timespan
  • TreatUncertainAsBad: bool = true
  • OtherValueSeries: dynamic = dynamic(null)

Usage:

GetTimeInState(TimeSeries, StartTime, EndTime, Interval, TreatUncertainAsBad, OtherValueSeries)

GetLinearInterpolateByTagName

Description:
Performs linear interpolation for a given set of tag names.

Parameters:

  • TagNames: dynamic
  • StartTime: datetime
  • EndTime: datetime
  • Interval: timespan
  • TreatUncertainAsBad: bool = true
  • SteppedTagNames: dynamic = dynamic(null)
  • ReturnInterpValOnly: bool = true

Usage:

GetLinearInterpolateByTagName(TagNames, StartTime, EndTime, Interval, TreatUncertainAsBad, SteppedTagNames, ReturnInterpValOnly)

GetTimeWeightedAverageByTagName

Description:
Calculates the time-weighted average for a given set of tag names. Supports linear and stepped calculations.

Parameters:

  • TagNames: dynamic
  • StartTime: datetime
  • EndTime: datetime
  • Interval: timespan
  • MaxAllowDiffTimeLinear: timespan = time(null)
  • MaxAllowDiffTimeStepped: timespan = time(3650.00:00:00)
  • TreatUncertainAsBad: bool = true
  • SteppedTagNames: dynamic = dynamic(null)
  • MinRawValCount: int = 0

Usage:

GetTimeWeightedAverageByTagName(TagNames, StartTime, EndTime, Interval, MaxAllowDiffTimeLinear, MaxAllowDiffTimeStepped, TreatUncertainAsBad, SteppedTagNames, MinRawValCount)

GetTimeInStateByTagName

Description:
Calculates the time spent in each state for a given set of tag names.

Parameters:

  • TagNames: dynamic
  • StartTime: datetime
  • EndTime: datetime
  • Interval: timespan
  • TreatUncertainAsBad: bool = true
  • OtherValueTagNames: dynamic = dynamic(null)

Usage:

GetTimeInStateByTagName(TagNames, StartTime, EndTime, Interval, TreatUncertainAsBad, OtherValueTagNames)

GetIntegralByTagName

Description:
Calculates the integral (area under the curve) for a given set of tag names. Supports linear and stepped calculations.

Parameters:

  • TagNames: dynamic
  • StartTime: datetime
  • EndTime: datetime
  • Interval: timespan
  • MaxAllowDiffTimeLinear: timespan = time(null)
  • MaxAllowDiffTimeStepped: timespan = time(3650.00:00:00)
  • TreatUncertainAsBad: bool = true
  • SteppedTagNames: dynamic = dynamic(null)
  • MinRawValCount: int = 0

Usage:

GetIntegralByTagName(TagNames, StartTime, EndTime, Interval, MaxAllowDiffTimeLinear, MaxAllowDiffTimeStepped, TreatUncertainAsBad, SteppedTagNames, MinRawValCount)

GetPercentilesByTagName

Description:
Calculates percentiles for a given set of tag names by sorting values and assigning row numbers.

Parameters:

  • TagNames: dynamic
  • StartTime: datetime
  • EndTime: datetime
  • PercentileArray: dynamic = dynamic([25, 50, 75])
  • TreatUncertainAsBad: bool = true

Usage:

GetPercentilesByTagName(TagNames, StartTime, EndTime, PercentileArray, TreatUncertainAsBad)

GetPercentileEstimatesByTagName

Description:
Calculates percentile estimates using T-Digest for approximation for a given set of tag names.

Parameters:

  • TagNames: dynamic
  • StartTime: datetime
  • EndTime: datetime
  • PercentileArray: dynamic = dynamic([25, 50, 75])
  • TreatUncertainAsBad: bool = true

Usage:

GetPercentileEstimatesByTagName(TagNames, StartTime, EndTime, PercentileArray, TreatUncertainAsBad)

GetStatisticsByTagName

Description:
Calculates various statistics (first, last, min, max, avg, standard deviation, count) for a given set of tag names.

Parameters:

  • TagNames: dynamic
  • StartTime: datetime
  • EndTime: datetime
  • TreatUncertainAsBad: bool = true
  • ExcludeFirst: bool = false
  • ExcludeLast: bool = false

Usage:

GetStatisticsByTagName(TagNames, StartTime, EndTime, TreatUncertainAsBad, ExcludeFirst, ExcludeLast)

GetTimeWeightedStandardDeviation

Description:
Calculates the time-weighted standard deviation for each interval in a time series.

Parameters:

  • TimeSeries: dynamic
  • StartTime: datetime
  • EndTime: datetime
  • Interval: timespan
  • TreatUncertainAsBad: bool = true
  • SteppedSeries: dynamic = dynamic(null)

Usage:

GetTimeWeightedStandardDeviation(TimeSeries, StartTime, EndTime, Interval, TreatUncertainAsBad, SteppedSeries)

GetTimeWeightedStandardDeviationByTagName

Description:
Calculates the time-weighted standard deviation for each interval in a time series for a given set of tag names.

Parameters:

  • TagNames: dynamic
  • StartTime: datetime
  • EndTime: datetime
  • Interval: timespan
  • TreatUncertainAsBad: bool = true
  • SteppedTagNames: dynamic = dynamic(null)

Usage:

GetTimeWeightedStandardDeviationByTagName(TagNames, StartTime, EndTime, Interval, TreatUncertainAsBad, SteppedTagNames)

GetTimeWeightedStatistics

Description:
Calculates time-weighted average and standard deviation statistics for each interval in a time series.

Parameters:

  • TimeSeries: dynamic
  • StartTime: datetime
  • EndTime: datetime
  • Interval: timespan
  • MaxAllowDiffTimeLinear: timespan = time(null)
  • MaxAllowDiffTimeStepped: timespan = time(3650.00:00:00)
  • TreatUncertainAsBad: bool = true
  • SteppedSeries: dynamic = dynamic(null)
  • MinRawValCount: int = 0

Usage:

GetTimeWeightedStatistics(TimeSeries, StartTime, EndTime, Interval, MaxAllowDiffTimeLinear, MaxAllowDiffTimeStepped, TreatUncertainAsBad, SteppedSeries, MinRawValCount)

GetTimeWeightedStatisticsByTagName

Description:
Calculates time-weighted average and standard deviation statistics for each interval in a time series for a given set of tag names.

Parameters:

  • TagNames: dynamic
  • StartTime: datetime
  • EndTime: datetime
  • Interval: timespan
  • MaxAllowDiffTimeLinear: timespan = time(null)
  • MaxAllowDiffTimeStepped: timespan = time(3650.00:00:00)
  • TreatUncertainAsBad: bool = true
  • SteppedTagNames: dynamic = dynamic(null)
  • MinRawValCount: int = 0

Usage:

GetTimeWeightedStatisticsByTagName(TagNames, StartTime, EndTime, Interval, MaxAllowDiffTimeLinear, MaxAllowDiffTimeStepped, TreatUncertainAsBad, SteppedTagNames, MinRawValCount)